import request from '../../utils/request.js'

// 获取ai画图得到的base64 img链接
export function getAiDrawPic(question,width,height) {
    return request({
        url: `/aiChat/draw?question=${question}&width=${width}&height=${height}`,
        method: 'get'
    })
}

// 创建角色模拟时的玩家
export function savePlayer(player) {
    return request({
        url: '/aiChat/playerRegister',
        method: 'post',
        data: player
    })
}

// 查询角色名字是否存在
export function selectPlayer(playerName) {
    return request({
        url: '/aiChat/judgePlayerReigster?playerName=' + playerName,
        method: 'get'
    })
}

// 获取当前用户创建的全部的玩家列表
export function getPlayerInfoList() {
    return request({
        url: '/aiChat/getPlayerInfo',
        method: 'get'
    })
}

// 获取用户创建的玩家所创建的人格信息
export function getAgentInfo(playerId) {
    return request({
        url: '/aiChat/getAgentInfo?playerId=' + playerId,
        method: 'get',
    })
}

// 创建人格信息
export function saveAgent(data) {
    return request({
        url: '/aiChat/agentCreate',
        method: 'post',
        data: data
    })
}

// 生成短期记忆
export function generateMemory(data) {
    return request({
        url: '/aiChat/generateMemory',
        method: 'post',
        data: data
    })
}

// 用户进入页面时 需要清空和ai的对话历史记录
export function clearChatHistory() {
    return request({
        url: '/aiChat/clearChatHistory',
        method: 'get'
    })
}